<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/radardevice/devices/deviceinfo.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/radardevice/devices/deviceinfo.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '设备信息',
                name: 'devices/deviceinfo',
                url: "/deviceinfo/",
                sortName: "online,runtime,CreateDate"
            });
            const editFormFields = ref({"deviceNo":""});
            const editFormOptions = ref([[{"title":"设备编号","required":true,"field":"deviceNo","type":"text"}]]);
            const searchFormFields = ref({"deviceNo":"","online":"","CreateDate":""});
            const searchFormOptions = ref([[{"title":"设备编号","field":"deviceNo","type":"like"},{"dataKey":"enable","data":[],"title":"是否在线","field":"online","type":"select"}],[{"title":"添加时间","field":"CreateDate","type":"datetime"}]]);
            const columns = ref([{field:'id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'deviceNo',showOverflowTooltip:'true',title:'设备编号',type:'string',width:170,require:true,align:'left',sort:true},
                       {field:'online',title:'是否在线',type:'sbyte',bind:{ key:'enable',data:[]},sort:true,width:100,readonly:true,align:'left'},
                       {field:'softStatus',title:'软件状态',type:'string',width:80,align:'left'},
                       {field:'targetDistance1',title:'目标1距离',type:'int',width:85,align:'left'},
                       {field:'targetSnr1',title:'目标1SNR',type:'decimal',width:85,align:'left'},
                       {field:'targetDistance2',title:'目标2距离',type:'int',width:85,align:'left'},
                       {field:'targetSnr2',title:'目标2SNR',type:'decimal',width:85,align:'left'},
                       {field:'targetDistance3',title:'目标3距离',type:'int',width:85,align:'left'},
                       {field:'targetSnr3',title:'目标3SNR',type:'decimal',width:85,align:'left'},
                       {field:'sinNo',title:'Sin卡号',showOverflowTooltip:'true',type:'string',width:177,readonly:true,align:'left'},
                       {field:'longitude',title:'经度',type:'string',width:80,readonly:true,align:'left'},
                       {field:'latitude',title:'维度',type:'string',width:80,readonly:true,align:'left'},
                       {field:'runtime',title:'运行时长(分钟)',type:'int',sort:true,width:130,readonly:true,align:'left'},
                       {field:'signal',title:'LTE信号强度',type:'decimal',width:100,readonly:true,require:true,align:'left'},
                       {field:'voltage',title:'电压(V)',type:'decimal',width:90,readonly:true,align:'left'},
                       {field:'redarNum',title:'搭载雷达个数',type:'int',width:100,readonly:true,align:'left'},
                       {field:'CreateID',title:'添加人Id',type:'int',width:100,hidden:true,readonly:true,align:'left'},
                       {field:'Creator',title:'添加人',type:'string',width:100,hidden:true,readonly:true,align:'left'},
                       {field:'CreateDate',title:'添加时间',showOverflowTooltip:'true',type:'datetime',sort:true,width:160,readonly:true,align:'left',sort:true},
                       {field:'updateTime',title:'更新时间',showOverflowTooltip:'true',type:'datetime',width:160,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
